<div class="flex flex-col sm:flex-row gap-4">
  <%= render 'menu' %>
  <div class="grow">
    <div class="card card-lg">
      <div class="card-body">
        <div class="card-section delete-account">
          <div class="heading"><%= t("users.delete_account") %></div>
          <%= form_for(@user, url: setting_path, method: :delete) do |f| %>
            <%= render "shared/error_messages", :target => resource if params[:by] == "destroy" %>
            <input type="hidden" name="by" value="destroy">
            <div class="form-group">
              <%= t("users.delete_account_tips_html") %>
            </div>
            <div class="form-group">
              <%= f.password_field :current_password, class: "form-control", style: "max-width: 400px", placeholder: t("users.confirm_delete_account") %>
            </div>
            <%= f.submit t("users.ensure_to_delete"), :class => "btn btn-danger", 'data-disable-with' => t("common.submitting") %>
          <% end %>
        </div>

        <% if !Setting.sso_enabled? && @user.authorizations.any? %>
          <div class="card-section authorizations">
            <div class="heading"><%= t("users.bind_another_account") %></div>
            <div class="flex">
              <div class="btn-group">
                <% @user.authorizations.each do |authorizaion| %>
                  <%= link_to auth_unbind_setting_path(authorizaion.provider), class: "btn btn-outline-warning", title: ("users.click_to_unbind"), method: 'delete' do %>
                    <i class="fas fa-minus-circle"></i>
                    <%= Homeland::Utils.omniauth_name(authorizaion.provider) %>
                  <% end %>
                <% end %>
              </div>
            </div>
          </div>
        <% end %>
      </div>
    </div>
  </div>
</div>
